package com.croot.infra.${projectFlag}.adapter.rdb.consts;

public enum ErrorCode {

    /**
     * 成功
     */
    SUCCESS(0, "成功"),

    /**
     * 失败
     */
    FAILURE(-1, "失败"),

<#list constsNameList as constsName>
    QUERY_${constsName.tableName!}_FAILED(${constsName.codeValue4Qry!}, "查询失败"),

    SAVE_${constsName.tableName!}_FAILED(${constsName.codeValue4Save!}, "保存失败"),

    DELETE_${constsName.tableName!}_FAILED(${constsName.codeValue4Del!}, "删除失败"),

    COUNT_${constsName.tableName!}_FAILED(${constsName.codeValue4Count!}, "计算记录数失败"),

    ID_${constsName.tableName!}_NOT_FOUNT(${constsName.codeValue4ID!}, "资源未找到"),

</#list>
    ;

    private int code;

    private String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
